﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%--formshow--%>

<script type="text/javascript">
    function getTable(btnTag) {
        var hidValue;
        var txtValue = "";
        var complete = true;

        var tableTag = $(btnTag).parent();
        var childTag = $(tableTag).children();

        childTag.each(function() {
            var cls = $(this).attr("class");
            if (cls == "txtTable txtunderline") {
                var txt = $(this).val();
                var name = $(this).attr("name");
                if (txt == "")
                    complete = false;
                txtValue += txt + ";";
            }
            else if (cls == "hidTable")
                hidValue = $(this).val();
        });

        //        if (!complete) {
        //            alert("必须填写完整条件");
        //            return;
        //        }

        $("#sqlargs").val(txtValue);

        $.ajax({
            type: "POST",
            url: "/Form/QueryTable",
            data: { "txtValue": txtValue, "sqlValue": hidValue },
            success: function(data) {
                if (data == "none") {
                    alert("无所需查询结果");
                } else {
                    $("#updateTable").html(data);
                }
            }
        });
    }

    // 该变量名必须为print
    var print = new PagingPrint();

    //    $(function() {
    //        pageLayout();
    //    })

    $(function() {
        $(".form_datepicker").datepicker();
    });
    
</script>

<div id="formshow">
    <div style="margin-top: 45px;">
        <%-- <input type="hidden" id="sqlargs" />
        <div id="datepicker" style="display: none; position: absolute; z-index: 102;">
        </div>--%>
        <div style="width: 650px; float: left; margin-left: 10px; background-color: #F9F9F9;
            border: solid 1px #6C92AD;">
            <div id="div_bd" style="position: relative; height: 800px; width: 600px; margin-left: 13px;
                overflow: auto; padding: 5px;">
                <%Response.Write(ViewData["formdefi"]); %>
            </div>
        </div>
        <%--<input type="button" onclick="ShowPrintPage();" value="打印" />--%>
        <input type="button" onclick="print.showPage(this);" value="打印" />
    </div>
    <%--    
    <input type="button" onclick="pageLayout();" value="布局" />--%>
</div>
